Skip to content

Conversation

@nikosdouvlis
Copy link
Member

@nikosdouvlis nikosdouvlis commented Jan 15, 2026

Summary

Testing package changes locally has been painful:

  • npm/pnpm linking doesn't always work and doesn't mimic real published package behavior (symlinks behave differently than installed packages)
  • YALC is an older solution with the same limitation - it doesn't map 1:1 with how packages behave when published to npm
  • The common workaround was pushing to a branch and waiting for snapshot releases, which takes 5+ minutes per iteration from push to install

Verdaccio solves this by running a local npm registry. Packages are built and published exactly as they would be to npm, then installed normally in test apps. This makes iteration cycles much shorter while testing real package behavior.

What changed

  • Added local:registry:up to start Verdaccio with npm proxy support
  • Added local:registry:down to stop the registry
  • Added local:registry:pub to build and publish all packages
  • Script displays install instructions when registry starts
  • Git changes are auto-reset after publishing

Usage

In the monorepo:

# Terminal 1 - Start the local registry
pnpm local:registry:up

# Terminal 2 - Build and publish all packages
pnpm local:registry:pub

# Or publish a single package
pnpm local:registry:pub:pkg @clerk/backend

# When done
pnpm local:registry:down

In your test app:

# Update package.json catalog to use "local" tag:
"@clerk/backend": "local",

# Install from local Verdaccio
bun install --registry http://localhost:4873

Test plan

  • Start registry with pnpm local:registry:up
  • Publish packages with pnpm local:registry:pub
  • Install in test app with bun install --registry http://localhost:4873
  • Verify installed versions match local build

Summary by CodeRabbit

  • New Features
    • Added npm scripts to manage a local development registry: local:registry:up (start), local:registry:down (stop), and local:registry:pub (publish packages)
    • Increased upload size limit for the local registry to 200MB to support larger packages

✏️ Tip: You can customize this high-level summary in your review settings.

@vercel
Copy link

vercel bot commented Jan 15, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
clerk-js-sandbox Ready Ready Preview, Comment Jan 16, 2026 5:00pm

Request Review

@changeset-bot
Copy link

changeset-bot bot commented Jan 15, 2026

⚠️ No Changeset found

Latest commit: 16b9c33

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 15, 2026

📝 Walkthrough

Walkthrough

The pull request introduces three new npm scripts in package.json that delegate to a new Bash script for managing a local Verdaccio npm registry. The shell script (scripts/local-registry.sh) provides commands to start the registry (up), stop it (down), and publish packages to it (pub). The publish workflow includes building packages, clearing storage, versioning with a snapshot, and publishing with a local tag. Additionally, the Verdaccio configuration file's max_body_size parameter is increased from 20mb to 200mb to accommodate larger request bodies.

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: adding a local Verdaccio workflow for testing packages, which is the primary purpose of all the modifications across package.json, the new shell script, and config file.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.



📜 Recent review details

Configuration used: Repository YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between eb86fcc and c3df152.

📒 Files selected for processing (3)
  • package.json
  • scripts/local-registry.sh
  • verdaccio.install.yaml
🚧 Files skipped from review as they are similar to previous changes (2)
  • package.json
  • verdaccio.install.yaml
🧰 Additional context used
📓 Path-based instructions (1)
**/*

⚙️ CodeRabbit configuration file

If there are no tests added or modified as part of the PR, please suggest that tests be added to cover the changes.

**/*: Only comment on issues that would block merging, ignore minor or stylistic concerns.
Restrict feedback to errors, security risks, or functionality-breaking problems.
Do not post comments on code style, formatting, or non-critical improvements.
Keep reviews short: flag only issues that make the PR unsafe to merge.
Group similar issues into a single comment instead of posting multiple notes.
Skip repetition: if a pattern repeats, mention it once at a summary level only.
Do not add general suggestions, focus strictly on merge-blocking concerns.
If there are no critical problems, respond with minimal approval (e.g., 'Looks good'). Do not add additional review.
Avoid line-by-line commentary unless it highlights a critical bug or security hole.
Highlight only issues that could cause runtime errors, data loss, or severe maintainability issues.
Ignore minor optimization opportunities, focus solely on correctness and safety.
Provide a top-level summary of critical blockers rather than detailed per-line notes.
Comment only when the issue must be resolved before merge, otherwise remain silent.
When in doubt, err on the side of fewer comments, brevity and blocking issues only.
Avoid posting any refactoring issues.

Files:

  • scripts/local-registry.sh
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (25)
  • GitHub Check: Integration Tests (quickstart, chrome, 16)
  • GitHub Check: Integration Tests (quickstart, chrome, 15)
  • GitHub Check: Integration Tests (react-router, chrome)
  • GitHub Check: Integration Tests (billing, chrome, RQ)
  • GitHub Check: Integration Tests (machine, chrome)
  • GitHub Check: Integration Tests (billing, chrome)
  • GitHub Check: Integration Tests (tanstack-react-start, chrome)
  • GitHub Check: Integration Tests (nextjs, chrome, 16)
  • GitHub Check: Integration Tests (astro, chrome)
  • GitHub Check: Integration Tests (nextjs, chrome, 16, RQ)
  • GitHub Check: Integration Tests (vue, chrome)
  • GitHub Check: Integration Tests (nuxt, chrome)
  • GitHub Check: Integration Tests (nextjs, chrome, 15)
  • GitHub Check: Integration Tests (handshake:staging, chrome)
  • GitHub Check: Integration Tests (machine, chrome, RQ)
  • GitHub Check: Integration Tests (sessions:staging, chrome)
  • GitHub Check: Integration Tests (custom, chrome)
  • GitHub Check: Integration Tests (sessions, chrome)
  • GitHub Check: Integration Tests (express, chrome)
  • GitHub Check: Integration Tests (generic, chrome)
  • GitHub Check: Integration Tests (localhost, chrome)
  • GitHub Check: Integration Tests (handshake, chrome)
  • GitHub Check: Integration Tests (ap-flows, chrome)
  • GitHub Check: Analyze (javascript-typescript)
  • GitHub Check: semgrep-cloud-platform/scan
🔇 Additional comments (1)
scripts/local-registry.sh (1)

1-73: Looks good.

The script is well-structured for its purpose. The use of npm_config_registry as an environment variable (line 54) instead of modifying npm config avoids the persistent config corruption risk flagged in previous reviews. The cleanup trap properly handles git restoration on exit.

✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.


Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@scripts/local-registry.sh`:
- Around line 44-51: Add a cleanup trap that always restores the npm registry
(and auth token) if the script exits or is interrupted: save the original
registry (e.g. ORIGINAL_REGISTRY=$(npm config get registry)) before setting npm
config to $REGISTRY_URL, create a cleanup function that runs on EXIT/ERR to
reset the registry and auth token back to the saved ORIGINAL_REGISTRY and remove
any temporary auth, and register it via trap 'cleanup' EXIT; apply this pattern
around the publish blocks (the pub and pub:pkg sections that call pnpm changeset
publish and npm publish) so failures in pnpm changeset publish or npm publish
still run cleanup and do not leave the global npm config pointing at
$REGISTRY_URL.
📜 Review details

Configuration used: Repository YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 9e4b30c and c427b00.

📒 Files selected for processing (2)
  • package.json
  • scripts/local-registry.sh
🧰 Additional context used
📓 Path-based instructions (4)
**/*

⚙️ CodeRabbit configuration file

If there are no tests added or modified as part of the PR, please suggest that tests be added to cover the changes.

**/*: Only comment on issues that would block merging, ignore minor or stylistic concerns.
Restrict feedback to errors, security risks, or functionality-breaking problems.
Do not post comments on code style, formatting, or non-critical improvements.
Keep reviews short: flag only issues that make the PR unsafe to merge.
Group similar issues into a single comment instead of posting multiple notes.
Skip repetition: if a pattern repeats, mention it once at a summary level only.
Do not add general suggestions, focus strictly on merge-blocking concerns.
If there are no critical problems, respond with minimal approval (e.g., 'Looks good'). Do not add additional review.
Avoid line-by-line commentary unless it highlights a critical bug or security hole.
Highlight only issues that could cause runtime errors, data loss, or severe maintainability issues.
Ignore minor optimization opportunities, focus solely on correctness and safety.
Provide a top-level summary of critical blockers rather than detailed per-line notes.
Comment only when the issue must be resolved before merge, otherwise remain silent.
When in doubt, err on the side of fewer comments, brevity and blocking issues only.
Avoid posting any refactoring issues.

Files:

  • scripts/local-registry.sh
  • package.json
**/*.{js,jsx,ts,tsx,json,md,yml,yaml}

📄 CodeRabbit inference engine (.cursor/rules/development.mdc)

Use Prettier for consistent code formatting

Files:

  • package.json
package.json

📄 CodeRabbit inference engine (.cursor/rules/development.mdc)

package.json: Requires Node.js 18.17.0+ and pnpm 9.15.9+
Regularly update dependencies

Files:

  • package.json
**/*.{js,ts,jsx,tsx,json,md,yml,yaml}

📄 CodeRabbit inference engine (.cursor/rules/monorepo.mdc)

Use Prettier for code formatting across all packages

Files:

  • package.json
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (25)
  • GitHub Check: Integration Tests (custom, chrome)
  • GitHub Check: Integration Tests (nextjs, chrome, 16, RQ)
  • GitHub Check: Integration Tests (generic, chrome)
  • GitHub Check: Integration Tests (vue, chrome)
  • GitHub Check: Integration Tests (astro, chrome)
  • GitHub Check: Integration Tests (machine, chrome)
  • GitHub Check: Integration Tests (localhost, chrome)
  • GitHub Check: Integration Tests (tanstack-react-start, chrome)
  • GitHub Check: Integration Tests (nuxt, chrome)
  • GitHub Check: Integration Tests (sessions, chrome)
  • GitHub Check: Integration Tests (nextjs, chrome, 15)
  • GitHub Check: Integration Tests (sessions:staging, chrome)
  • GitHub Check: Integration Tests (react-router, chrome)
  • GitHub Check: Integration Tests (ap-flows, chrome)
  • GitHub Check: Integration Tests (billing, chrome, RQ)
  • GitHub Check: Integration Tests (handshake, chrome)
  • GitHub Check: Integration Tests (nextjs, chrome, 16)
  • GitHub Check: Integration Tests (quickstart, chrome, 15)
  • GitHub Check: Integration Tests (quickstart, chrome, 16)
  • GitHub Check: Integration Tests (machine, chrome, RQ)
  • GitHub Check: Integration Tests (billing, chrome)
  • GitHub Check: Integration Tests (handshake:staging, chrome)
  • GitHub Check: Integration Tests (express, chrome)
  • GitHub Check: Analyze (javascript-typescript)
  • GitHub Check: semgrep-cloud-platform/scan
🔇 Additional comments (1)
package.json (1)

27-30: Looks good.

The new script entries correctly delegate to the shell script with appropriate command arguments.

✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.

Comment on lines 44 to 51
npm config set registry $REGISTRY_URL
npm config set //${REGISTRY_URL#http://}/:_authToken localToken

# Publish to Verdaccio
pnpm changeset publish --no-git-tag --tag local

# Reset npm registry
npm config set registry https://registry.npmjs.org
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

Missing cleanup handler leaves npm config corrupted on failure.

If pnpm changeset publish (line 48) or npm publish (line 88) fails, set -e exits immediately without resetting npm config. The user's global npm registry will remain pointing to localhost:4873, breaking all subsequent npm/pnpm operations.

Add a trap to ensure cleanup on exit:

Proposed fix
 set -e
 
 REGISTRY_URL="http://localhost:4873"
+
+cleanup_npm_config() {
+  npm config set registry https://registry.npmjs.org
+  npm config delete //${REGISTRY_URL#http://}/:_authToken 2>/dev/null || true
+}

Then in pub and pub:pkg, wrap the publish section:

     # Set npm registry to local Verdaccio
     npm config set registry $REGISTRY_URL
     npm config set //${REGISTRY_URL#http://}/:_authToken localToken
+    trap cleanup_npm_config EXIT
 
     # Publish to Verdaccio
     pnpm changeset publish --no-git-tag --tag local
 
-    # Reset npm registry
-    npm config set registry https://registry.npmjs.org
+    # Reset npm registry (also handled by trap)
+    cleanup_npm_config
+    trap - EXIT

Also applies to: 84-91

🤖 Prompt for AI Agents
In `@scripts/local-registry.sh` around lines 44 - 51, Add a cleanup trap that
always restores the npm registry (and auth token) if the script exits or is
interrupted: save the original registry (e.g. ORIGINAL_REGISTRY=$(npm config get
registry)) before setting npm config to $REGISTRY_URL, create a cleanup function
that runs on EXIT/ERR to reset the registry and auth token back to the saved
ORIGINAL_REGISTRY and remove any temporary auth, and register it via trap
'cleanup' EXIT; apply this pattern around the publish blocks (the pub and
pub:pkg sections that call pnpm changeset publish and npm publish) so failures
in pnpm changeset publish or npm publish still run cleanup and do not leave the
global npm config pointing at $REGISTRY_URL.

@pkg-pr-new
Copy link

pkg-pr-new bot commented Jan 15, 2026

Open in StackBlitz

@clerk/agent-toolkit

npm i https://pkg.pr.new/@clerk/agent-toolkit@7608

@clerk/astro

npm i https://pkg.pr.new/@clerk/astro@7608

@clerk/backend

npm i https://pkg.pr.new/@clerk/backend@7608

@clerk/chrome-extension

npm i https://pkg.pr.new/@clerk/chrome-extension@7608

@clerk/clerk-js

npm i https://pkg.pr.new/@clerk/clerk-js@7608

@clerk/dev-cli

npm i https://pkg.pr.new/@clerk/dev-cli@7608

@clerk/expo

npm i https://pkg.pr.new/@clerk/expo@7608

@clerk/expo-passkeys

npm i https://pkg.pr.new/@clerk/expo-passkeys@7608

@clerk/express

npm i https://pkg.pr.new/@clerk/express@7608

@clerk/fastify

npm i https://pkg.pr.new/@clerk/fastify@7608

@clerk/localizations

npm i https://pkg.pr.new/@clerk/localizations@7608

@clerk/nextjs

npm i https://pkg.pr.new/@clerk/nextjs@7608

@clerk/nuxt

npm i https://pkg.pr.new/@clerk/nuxt@7608

@clerk/react

npm i https://pkg.pr.new/@clerk/react@7608

@clerk/react-router

npm i https://pkg.pr.new/@clerk/react-router@7608

@clerk/shared

npm i https://pkg.pr.new/@clerk/shared@7608

@clerk/tanstack-react-start

npm i https://pkg.pr.new/@clerk/tanstack-react-start@7608

@clerk/testing

npm i https://pkg.pr.new/@clerk/testing@7608

@clerk/ui

npm i https://pkg.pr.new/@clerk/ui@7608

@clerk/upgrade

npm i https://pkg.pr.new/@clerk/upgrade@7608

@clerk/vue

npm i https://pkg.pr.new/@clerk/vue@7608

commit: 16b9c33

Why:
Testing package changes locally has been painful:
- npm/pnpm linking doesn't always work and doesn't mimic real published
  package behavior (symlinks behave differently than installed packages)
- YALC is an older solution with the same limitation - it doesn't map 1:1
  with how packages behave when published to npm
- The common workaround was pushing to a branch and waiting for snapshot
  releases, which takes 5+ minutes per iteration from push to install

Verdaccio solves this by running a local npm registry. Packages are built
and published exactly as they would be to npm, then installed normally in
test apps. This makes iteration cycles much shorter while testing real
package behavior.

What changed:
- Added `local:registry:up` to start Verdaccio with npm proxy support
- Added `local:registry:down` to stop the registry
- Added `local:registry:pub` to build, publish with snapshot versions, and
  auto-reset git changes after publishing

Usage:
  pnpm local:registry:up     # Start registry (Terminal 1)
  pnpm local:registry:pub    # Build & publish (Terminal 2)
  bun install --registry http://localhost:4873  # In test app
Copy link
Member

@bratsos bratsos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎖️

Copy link
Member

@octoper octoper left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔥

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants